<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="b" uri="/b2b-tags"%>
<div class="top_div">
	<div class="top">
		<div class="left fl"> 
			<c:choose>
			<c:when test="${not empty sessionScope.WEB_USER_TOKEN}">
				<c:choose>
        		  <c:when test="${not empty sessionScope.WEB_USER_TOKEN.agentToken}">
	        		  <c:choose>
							<c:when test="${sessionScope.WEB_USER_TOKEN.agentToken.agentName ne ''}">
								<span><b style="color: #35437d">${sessionScope.WEB_USER_TOKEN.agentToken.agentName }</b>    您好，欢迎访问“安徽宣城医药”,您正在代理采购商！</span><div class="dr fl"><a href="<c:url value="/agentuser/cancelAgent.s"/>"  style="width:60px;">取消代理</a></div>
							</c:when>
							<c:otherwise>
								<span><b style="color: #35437d">${sessionScope.WEB_USER_TOKEN.agentToken.loginName }</b>  您好，欢迎访问“安徽宣城医药”,您正在代理采购商！</span><div class="dr fl"> <a href="<c:url value="/agentuser/cancelAgent.s"/>"  style="width:60px;">取消代理</a></div>
							</c:otherwise>
					  </c:choose>
				  </c:when>
				  <c:otherwise>
				      <c:choose>
							<c:when test="${sessionScope.WEB_USER_TOKEN.userName ne ''}">
								<span>采购商<b style="color: #35437d">${sessionScope.WEB_USER_TOKEN.userName }</b>    您好，欢迎访问“安徽宣城医药”！</span><div class="dr fl"> <a class="fl" href="<c:url value="/user/loginOut.s" />" >注销</a></div>
							</c:when>
							<c:otherwise>
								<span>采购商<b style="color: #35437d">${sessionScope.WEB_USER_TOKEN.userName }</b>    您好，欢迎访问“安徽宣城医药”！</span><div class="dr fl"> <a class="fl" href="<c:url value="/user/loginOut.s" />" >注销</a></div>
							</c:otherwise>
				      </c:choose>
				</c:otherwise>
				</c:choose>
			</c:when>
			<c:when test="${not empty sessionScope.WEB_PROVIDER_TOKEN}">
				<c:choose>
        		  <c:when test="${not empty sessionScope.WEB_PROVIDER_TOKEN.agentToken}">
	        		  <c:choose>
							<c:when test="${sessionScope.WEB_PROVIDER_TOKEN.agentToken.agentName ne ''}">
								<span><b style="color: #35437d">${sessionScope.WEB_PROVIDER_TOKEN.agentToken.agentName }</b>    您好，欢迎访问“安徽宣城医药”,您正在代理供货商！</span><div class="dr fl"> <a href="<c:url value="/agentuser/cancelAgent.s"/>"  style="width:60px;">取消代理</a></div>
							</c:when>
							<c:otherwise>
								<span><b style="color: #35437d">${sessionScope.WEB_PROVIDER_TOKEN.agentToken.loginName }</b>  您好，欢迎访问“安徽宣城医药”,您正在代理供货商！</span><div class="dr fl"> <a href="<c:url value="/agentuser/cancelAgent.s"/>"  style="width:60px;">取消代理</a></div>
							</c:otherwise>
					  </c:choose>
				  </c:when>
				  <c:otherwise>
				      <c:choose>
							<c:when test="${sessionScope.WEB_PROVIDER_TOKEN.userName ne ''}">
								<span>供应商<b style="color: #35437d">${sessionScope.WEB_PROVIDER_TOKEN.userName }</b>    您好，欢迎访问“安徽宣城医药”！</span><div class="dr fl"> <a class="fl" href="<c:url value="/user/loginOut.s" />" >注销</a></div>
							</c:when>
							<c:otherwise>
								<span>供应商<b style="color: #35437d">${sessionScope.WEB_PROVIDER_TOKEN.loginName }</b>  您好，欢迎访问“安徽宣城医药”！</span><div class="dr fl"> <a class="fl" href="<c:url value="/user/loginOut.s" />" >注销</a></div>
							</c:otherwise>
				      </c:choose>
				</c:otherwise>
				</c:choose>
			</c:when>
			<c:when test="${not empty sessionScope.WEB_AGENT}">
				<c:choose>
					<c:when test="${sessionScope.WEB_AGENT.agentName ne ''}">
						<span><b style="color: #35437d">${sessionScope.WEB_AGENT.agentName }</b>    您好，欢迎访问“安徽宣城医药”！</span><div class="dr fl"> <a class="fl" href="<c:url value="/user/loginOut.s" />" >注销</a></div>
					</c:when>
					<c:otherwise>
						<span><b style="color: #35437d">${sessionScope.WEB_AGENT.loginName }</b>  您好，欢迎访问“安徽宣城医药”！</span><div class="dr fl"> <a class="fl" href="<c:url value="/user/loginOut.s" />" >注销</a></div>
					</c:otherwise>
				</c:choose>
			</c:when>
			
			<c:otherwise>
				<span>您好，欢迎访问“安徽宣城医药”！</span><div class="dr fl"> <a class="fl" href="<c:url value="/views/jsp/login.jsp" />" >登录</a></div>
			</c:otherwise>
			</c:choose>
		</div>
		<div class="right fr">
			<ul>
<%-- 				<c:if test="${not empty sessionScope.WEB_USER_TOKEN}">
					<li class="gwc"><a href="<c:url value="/views/jsp/center/trade/shoppingcart/c_shopping_cart_list.jsp" />" >购物车</a></li>
					<li><a href="<c:url value="/views/jsp/center/trade/order/c_order_list.jsp" />" >我的订单</a></li>
				</c:if> --%>
				<li class="xian"><a  href="<c:url value="/views/jsp/center/c_user_center.jsp" />"  >会员中心</a></li>
				<li><a  href="javascript:void('0');" id="fav" >收藏本站</a></li>
				<li><a  href="javascript:void('0');" id="addHomePage" >设为首页</a></li>
 <%--				<li class="sj"><a  href="<c:url value="/views/jsp/mobile/index.jsp" />"  >手机版</a></li> --%>
			</ul>
		</div>

	</div>
</div>

<c:if test="${not empty keyvalue.INDEX_TOP1 }">
	<c:import url="/views/jsp/include/_ad_top.jsp"></c:import>
</c:if>
<!--头部结束-->

<script>
//收藏本站代码
jQuery.fn.addFavorite = function(l, h) {
    return this.click(function() {
        var t = jQuery(this);
        if(jQuery.browser.msie) {
            window.external.addFavorite(h, l);
        } else if (jQuery.browser.mozilla || jQuery.browser.opera) {
            t.attr("rel", "sidebar");
            t.attr("title", l);
            t.attr("href", h);
        } else {
        	layer.msg("请使用Ctrl+D将本页加入收藏夹！");  
        }
    });
};
$(function(){
    $('#fav').addFavorite('收藏本站',location.href);
  //设置主页
    $("#addHomePage").click(function () { 
        if (document.all) {//设置IE  
    		 document.body.style.behavior = 'url(#default#homepage)'; 
    		 document.body.setHomePage(document.URL); 
        }else{//网上可以找到设置火狐主页的代码，但是点击取消的话会有Bug，因此建议手动设置  
        	layer.msg("设置首页失败，请手动设置！");  
        }  
    });
});

</script>